<?php
require_once ROOT_DIR."/view/widget/decorator/Abstract.php";

class ListContentType extends View_Widget_Decorator_Abstract 
{
	public function __construct(&$widget)
	{
		parent::__construct($widget);
	}
	
	public function paint()
	{
		$html = "";
		if ($this->widget->valid())
		{
			foreach ($this->widget as $widget) 
			{
				$html .= "<p style='padding-left: ". $this->widget->getDepth()*15 
				."px;'><a href='/admin/content/showArticlesOf/".$widget->getId()
				."'>".$widget->getTypeHeader()
				."</a> <span class='systemKey'>(<a href='/admin/content/editContentType/".$widget->getId()
				."'>edit</a> <a href='/admin/content/deleteContentType/".$widget->getId()
				."'>del</a>)</span></p>\n";
			}
		}
		return $html;	
	}
}
?>